package com.tj.template.application.trade.input;

import com.fqgj.common.api.ParamsObject;
import com.tj.bo.common.conf.util.ParamsValidateUtil;
import com.tj.bo.trade.client.enums.TradeTypeEnum;

/**
 * @program: binary-option
 * @description
 * @author: binary
 * @create: 2020-06-11 10:04
 **/
public class TradeListRequest extends ParamsObject {

    /**
     * 交易类型 0：虚拟订单 1：真实订单
     */
    private Integer tradeType;
    /**
     * 当前页数
     */
    private Integer pageNo;

    public Integer getTradeType() {
        return tradeType;
    }

    public TradeListRequest setTradeType(Integer tradeType) {
        this.tradeType = tradeType;
        return this;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public TradeListRequest setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
        return this;
    }

    @Override
    public void validate() {
        ParamsValidateUtil.checkParams(TradeTypeEnum.getEnumByCode(tradeType) == null, "tradeType is invalid");
        ParamsValidateUtil.checkParams(pageNo == null, "pageNo can not be empty");
    }
}
